<template>
  <div class="">
    <list-item
      class="eval-test-result-list-item"
      v-for="(item, index) in data.docs"
      :key="index"
      :tags="[item.StatusLabel]"
      :date="item.LastUpdateDate"
      :title="item.名称"
      :content="item.处理意见"
    ></list-item>

    <div
      v-if="data && data.total === 0"
      class="no-data-label">
      <div class="absolute-center">
        {{$t('暂无数据')}}
      </div>
    </div>

    <pagination v-if="data && data.total" :data="data" @changed="pageChanged"></pagination>
  </div>
</template>

<script>
import mixins from 'eis-admin-mixins';
import { RefreshOnLocaleChange } from '../../components/mixins/locale';
import listItem from '../../components/listItem.vue';
import pagination from '../../components/pagination.vue';

export default {
  name: 'IndustryEvalResultsList',
  mixins: [mixins.ObjectDataMixin, RefreshOnLocaleChange],
  components: {
    listItem,
    pagination,
  },
  methods: {
    pageChanged(p) {
      this.refreshData({ page: p });
    },
  },
};
</script>

<style lang="scss" scoped>
  .eval-test-result-list-item {
    :deep(.tags) {
      .tag- {
        &Finished,&检测完成 {
          background-color: $positive !important;
        }
        &Pending,&检测中 {
          background-color: #fcc966 !important;
        }
        &Running,&检测中 {
          background-color: $info !important;
        }
        &Failed,&检测失败 {
          background-color: $negative !important;
        }
      }
    }

  }
</style>
